package com.ckn.strategy;

import com.ckn.factory.PayFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @Author chenkangning
 * @Date 2024/6/14 10:14
 */
@Component
public class AlibabaPay implements PayHandler, InitializingBean {

    @Override
    public String doPay(String payCode) {
        System.out.println("使用阿里巴巴支付宝支付");
        return "支付宝支付";
    }

    @Override
    public void afterPropertiesSet(){
        PayFactory.register("alibaba",this);
    }
}
